﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace StatsData.Data.Migrations
{
    public partial class add_table_t_line_motion : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "LINE_NAME",
                table: "T_ANDON_DATA",
                type: "NVARCHAR2(600)",
                maxLength: 600,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "NVARCHAR2(2000)",
                oldNullable: true);

            migrationBuilder.CreateTable(
                name: "T_LINE_MOTION",
                columns: table => new
                {
                    ID = table.Column<string>(type: "VARCHAR2(50)", maxLength: 50, nullable: false),
                    LINE_CODE = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    LINE_NAME = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    USER_CODE = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    USERNAME = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    MOTIONER_POSITION = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    MOTIONER_LEVEL = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    MOTIONER_NAME = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    MOTIONER_LOCATION = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    CODE = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    MOTION_DATE = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false),
                    CATEGORY = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    FINISH_DATE = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false),
                    DESC = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    DESC_IMAGE = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    IMPROVE_DESC = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    IMPROVE_DESC_IMAGE = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    AMOUNT_SAVED = table.Column<decimal>(type: "NUMBER(18,6)", precision: 18, scale: 6, nullable: false),
                    BENEFIT = table.Column<string>(type: "NVARCHAR2(600)", maxLength: 600, nullable: true),
                    ORG_ID = table.Column<string>(type: "NVARCHAR2(50)", maxLength: 50, nullable: true),
                    CREATE_TIME = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true),
                    MODIFY_TIME = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true),
                    IS_DELETED = table.Column<bool>(type: "NUMBER(1)", nullable: false),
                    ROW_VERSION = table.Column<int>(type: "NUMBER(10)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_LINE_MOTION", x => x.ID);
                });

            migrationBuilder.CreateIndex(
                name: "IX_T_LINE_MOTION_CREATE_TIME",
                table: "T_LINE_MOTION",
                column: "CREATE_TIME");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_LINE_MOTION");

            migrationBuilder.AlterColumn<string>(
                name: "LINE_NAME",
                table: "T_ANDON_DATA",
                type: "NVARCHAR2(2000)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "NVARCHAR2(600)",
                oldMaxLength: 600,
                oldNullable: true);
        }
    }
}
